package com.itheima.duotai;

public class Test {

    public static void main(String[] args) {
        Sheep sheep = new Sheep();
        System.out.println(sheep.mao);
        sheep.eat();

        Wolf wolf = new Wolf();
        System.out.println(wolf.mao);
        wolf.eat();
     /*  Sheep  sheep= new Wolf();
        System.out.println(sheep.mao);//羊毛  运行看 左边
        /*sheep.age;
        sheep.birthday;
        //编译看左边
         */
        sheep.eat();//狼吃羊  运行看右边
       /* sheep.jiao();
        sheep.hao();
        //编译也看左边
        */


    }
}


class Sheep{
    String mao="羊毛";
    int  age;
    public void eat(){
        System.out.println("羊吃草");
    }
    public void jiao(){
        System.out.println("咩");
    }
}
class Wolf extends Sheep{// 披着羊皮的狼
        int birthday;
    String  mao="狼毫";
    @Override
      public void eat(){
            System.out.println("狼吃羊");
    }
    public void hao(){
        System.out.println("嗷呜");
    }
}
